package com.solidtrust.crawler.controller;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.solidtrust.crawler.service.GanjiService;
import com.solidtrust.crawler.service.PriceMetaDataService;

@Controller
@RequestMapping("/crawl/meta")
public class MetaDataCrawler {

	@Autowired GanjiService ganjiSvc;
	@Autowired PriceMetaDataService priceSvc;
	
	//used for GanjiSitemap
	@RequestMapping("ganji")
	public void ganjiModel() throws IOException{
		ganjiSvc.crawlCity();
		ganjiSvc.crawlModel();
		ganjiSvc.crawlCategory();
	}

	@RequestMapping("brand_model")
	public void brand_model(Integer start) throws IOException{
		priceSvc.brand_model(start);
	}
	
	@RequestMapping("build_volume")
	public void build_volume() throws IOException{
		priceSvc.build_volume();
	}
}
